<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html >
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Registration Form</title>
<script language="javascript">
		var xmlHttp;
		function checkUserExist() {
			var ebay_id = document.register.ebay_id.value;		
			if(window.XMLHttpRequest){
				xmlHttp = new XMLHttpRequest();
				xmlHttp.open("Get","/actions/SearchUser?ebay_id="+ebay_id,true);
				
				xmlHttp.onreadystatechange=callback;
				
			
				xmlHttp.send();
				
			}
			else if(window.ActiveXObject){
				xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
				
				xmlHttp.open("Get","/actions/SearchUser?ebay_id="+ebay_id,true);
							
				xmlHttp.onreadystatechange = callback;
				
				
				xmlHttp.send();
			
			}
			else
				{
				alert("problem");
				}
				
		}
		
		function callback() {
				if( xmlHttp.readyState==4 ){
					alert("in ready");
					if( xmlHttp.status==200 ) {
						document.register.thetable.innerHTML = "<br/><b>"+xmlHttp.responseText+"</b>";
						}
					else{
					alert(xmlHttp.status);
					}
				
			}
		}
		
		function focusIn(){
			document.getElementById("ebay_id").focus( );
		}  	
		

  	</script>
    
</head>
<body onload="focusIn();"><form method="post" action="register1" name="register">
<table width="100%">
<tr>
<td width="60%">
<img src="../../ebayimages/ebay-logo.jpg" width="10%" height="10%">
<td><img src="../../ebayimages/ebaysecurity1.png" width="5%" height="10%"/>Ebay Buyer Protection &nbsp;&nbsp;&nbsp;<a href="">Learn more</a>
</tr>
</table>
<hr color="red" width="100%">

<h2>Register With E-bay</h2>
<hr width="100%">
<br>
Tell us about yourself(All fields are required)
<hr width="100%">
<table>
<tr>
<td>
First Name:<td><input type="text" name="fname" required/>
<tr>
<td >
Last Name:<td><input type="text" name="lname" required/>
<tr>
<td >
Street Address:<td><input type="text" name="streetaddress" required/>
<tr>
<td >
Zip:<td><input type="text" name="zip" required/>
<tr>
<td >
City:<td><input type="text" name="city" required/>
<tr>
<td >
State:<td><input type="text" name="state" required/>

<tr>
<td >
Country:<td><input type="text" name="country" required/>


<tr><td>
Email-id<td><input type="text" name="email" id="email" required/><br>
<tr><td>
Re-enter your email-id<td><input type="text" name="reemail" required/><br>
<tr><td>
Your Phone no<td><input type="text" name="phone_no" required/><br>
<tr><td>
</table>

<h2>Create your ebay id and password</h2>
<br><table>
<tr><td>Create your ebay-id:<td><input type="text" name="ebay_id" id="ebay_id" required/>
<td><input type="button" value="Check Availability" onClick="checkUserExist()" required>
<span id="thetable"></span>
<tr><td colspan="2">Create your password:<td><input type="password" name="password" required/>
<tr><td colspan="2">Re-enter your password:<td><input type="password" name="repassword" required/>
<tr><td colspan="2">Select your secret question:<td><input type="text" name="secret_question" required/>
<tr><td colspan="2">Your secret answer:<td><input type="text" name="secret_answer" required/>
<tr><td colspan="2">Date of birth:</td>
<td colspan="2"> <input type="text" name="dob" required/>
</table>
<center>
<input type="submit" value="REGISTER" name="register1"/>
</center>
</form>
</body>

</html>